package Controller.MusicGender;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import Bean.joinHadoopBean;
import Dao.MusicGenderDao;

public class MusicGenderListContoller implements Controller{
	private MusicGenderDao dao;
	public void setDao(MusicGenderDao dao) {
		this.dao = dao;
	}
	@Override
	public ModelAndView handleRequest(HttpServletRequest req,
			HttpServletResponse arg1) throws Exception {
		System.out.println("노래별 성별 선호도 컨트롤러");
		
		List<joinHadoopBean> musicgender = dao.musicgenderList();
		for (joinHadoopBean joinHadoopBean : musicgender) {
			System.out.println("====================");
			System.out.println(joinHadoopBean.getMusicbean().getMs_title());
			System.out.println(joinHadoopBean.getMusicglbean().getMugl_count());
			System.out.println(joinHadoopBean.getMusicglbean().getMugl_gender());
		}
		
		ModelAndView mav = new ModelAndView();
		mav.setViewName("musicgenderlike");
		mav.addObject("musicgender",musicgender);
		return mav;
	}

}
